package com.gzy.android_douban.data.api;

import io.reactivex.Observable;
import java.util.List;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * @author : guzy
 * @program: net-app
 * @description: 课堂api
 * @date : 2022-03-26 11:27
 **/
public interface ApiService {

  // public static String mBaseUrl = "http://124.221.182.86:8080/web-lesson-server/";
  public static String mBaseUrl = "http://ehp5ip.natappfree.cc/web_lesson_server_war_exploded/";
  // public static String mBaseUrl = "http://139.155.21.79:8080/web-lesson3-server/";
  //获取验证码
  // @GET("api/validate-code")
  // Observable<CodeBean> getCodePicture();

  //登录接口
  @POST("api/login")
  Observable<ResponseBody> loginApi(@Body RequestBody body);

  // //注册
  // @POST("register")
  // Observable<ResponseBody> registerApi(@Body RequestBody body);
  //
  // //退出用户
  // @POST("layout")
  // Observable<ResponseBody> layoutApi(@Body RequestBody body);

  //识别脸部照片
  @POST("api/face")
  @Multipart
  Observable<ResponseBody> uploadFacePhoto2(@Part MultipartBody.Part part, @Part("token") RequestBody token);

  //发布作品
  @POST("api/image-info")
  @Multipart
  // Observable<ImageInfoBean> createOneImageInfoApi(@Part MultipartBody.Part part,
  //                                                 @Part("token") RequestBody token,
  //                                                 @Part("login") RequestBody login,
  //                                                 @Part("imageText") RequestBody imageText,
  //                                                 @Part("publishStatus") RequestBody publishStatus);

  //获取所有作品列表
  // @GET("api/image-info")
  // Observable<List<ImageInfoBean>> getAllImageInfoApi(@Query("token") String token);

  //获取 单个作品
  // @GET("api/image-info")
  // Observable<ImageInfoBean> getOneImageInfoApi(@Query("imageId") String imageId, @Query("token") String token);

  //删除作品
  @DELETE("api/image-info")
  Observable<ResponseBody> deleteOneImageInfoApi(@Query("imageId") String imageId, @Query("token") String token);

}
